
import java.awt.*;

public class ShotBullet extends Bullet
{
    /**
     * 射击出来的子弹
     */
    public FloatPoint position;//位置
    public static boolean isAlive = true;//是否活着
    private int type;//状态
    private float speedX = 6.0F;//x坐标
    private float speedY = 6.0F;//y坐标
    public float size = 8.0F;//大小
    public static int energy = 80;

    public ShotBullet(FloatPoint position, int direction, int type, float speedX, float speedY)//位置，方向，状态，x,y
    { super(position, isAlive, energy);
        this.speedX = speedX;
        this.speedY = speedY;
        this.type = type;
        this.position = position; }

    public void drawBubblet(Graphics2D g, float mapPosition)
    {
        if (isAlive) {
            this.position.x += this.speedX;
            this.position.y += this.speedY;
            g.drawImage(Imgs.STRONGBULLET, (int)(this.position.x - mapPosition) * 3 - (int)this.size,
                    (int)this.position.y * 3 - (int)this.size, (int)this.size * 2, (int)this.size * 2,
                    null);
        }
    }
}